#ifndef _FLOADER_H_
#define _FLOADER_H_

namespace Font
{

	class Library;
	class Metrics;

	class Loader
	{
	
	public:
	
		Loader(Library* a_Library);
		~Loader();
	
		Library* GetLibrary();

		virtual bool LoadDefault() = 0;
		virtual Face* LoadFace(Family* a_Family, const tb::String& a_Settings) = 0;

		virtual Metrics* CreateMetrics(Family* a_Family, unsigned int a_Style, CharMap* a_CharMap) = 0;

		Face* CreateFace(Family* a_Family, Metrics* a_Metrics);
		FaceHandle* FindFont(Family* a_Family, unsigned int a_Size, unsigned int a_Properties, CharMap* a_Map /*= NULL*/);

		void SetCharMap(const tb::String& a_FamilyName, CharMap* a_Map);
		CharMap* GetCharMap(const tb::String& a_FamilyName);

	protected:

		Library* m_Library;

		std::map<std::string, CharMap*> m_MapFamilyDefault;
		std::map<std::string, std::vector<Face*>> m_Faces;
	
	}; // class Loader

}; // namespace Font
	
#endif